const path = require('path')
const resolve = dir => path.join(__dirname, dir)
const publicPath = process.env.NODE_ENV === 'production' ? '/production/' : '/'
module.exports = {
  lintOnSave: false,
  publicPath,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('_c', resolve('src/components'))
  },
  productionSourceMap: false,
  devServer: {
    host: 'localhost',
    port: 8080,
    proxy: {
      '/api': {
        target: 'https://www.imooc.com',
        changeOrigin: true,
        pathRewrite: {
          '/api': ''
        }
      }
    }
  }
}
